<nz-breadcrumb class="breadcrumb">
  <nz-breadcrumb-item>
    <a routerLink="/Home">首页</a>
  </nz-breadcrumb-item>
  <nz-breadcrumb-item>车位收费信息列表</nz-breadcrumb-item>
</nz-breadcrumb>
<form nz-form class="search-form" [formGroup]="searchForm" (keydown.enter)="$event.preventDefault();onSearch()" nzLayout="inline">
  <nz-form-item>
    <nz-form-label nzFor="parkingAreaNumber">车位号</nz-form-label>
    <nz-form-control>
      <nz-input-group nzSearch [nzAddOnAfter]="parkingAreaNumberSuffixIconButton">
        <input nz-input formControlName="parkingAreaNumber" placeholder="请选择车位号" readonly />
      </nz-input-group>
      <ng-template #parkingAreaNumberSuffixIconButton>
        <button nz-button nzType="primary" nzSearch (click)="findParkingArea()"><nz-icon nzType="search" /></button>
      </ng-template>
    </nz-form-control>
  </nz-form-item>
  <nz-form-item>
    <nz-form-label nzFor="residentRoomNumber">单元房号</nz-form-label>
    <nz-form-control>
      <nz-input-group nzSearch [nzAddOnAfter]="residentRoomNumberSuffixIconButton">
        <input nz-input formControlName="residentRoomNumber" placeholder="请选择单元房号" readonly />
      </nz-input-group>
      <ng-template #residentRoomNumberSuffixIconButton>
        <button nz-button nzType="primary" nzSearch (click)="findRoom()"><nz-icon nzType="search" /></button>
      </ng-template>
    </nz-form-control>
  </nz-form-item>
  <nz-form-item>
    <nz-form-label nzFor="licensePlate">车牌</nz-form-label>
    <nz-form-control>
      <input nz-input formControlName="licensePlate" placeholder="请输入车牌" />
    </nz-form-control>
  </nz-form-item>
  <button nz-button type="button" nzType="primary" [nzLoading]="searchLoading" (click)="onSearch()">查询</button>
  <button nz-button type="button" class="margin-button" (click)="onReset()">重置</button>
  <button nz-button type="button" class="margin-button" nzType="primary" (click)="onAdd()">新增</button>
  <button nz-button type="button" class="margin-button" nzType="primary" [nzLoading]="searchLoading" (click)="onExport()">导出</button>
</form>
<nz-table #basicTable [nzData]="listOfData" [nzTotal]="total" [nzLoading]="searchLoading" nzSize="small">
  <thead>
    <tr>
      <th>车位号</th>
      <th>单元房号</th>
      <th>车牌</th>
      <th>使用开始时间</th>
      <th>使用结束时间</th>
      <th>金额</th>
      <th>备注</th>
      <th nzWidth="250px">操作</th>
    </tr>
  </thead>
  <tbody>
    <tr *ngFor="let data of basicTable.data">
      <td>{{data.parkingAreaNumber}}</td>
      <td>{{data.residentRoomNumber}}</td>
      <td>{{data.licensePlate}}</td>
      <td>{{data.billingStartDate}}</td>
      <td>{{data.billingEndDate}}</td>
      <td>{{data.amount}}</td>
      <td>{{data.remark}}</td>
      <td>
        <button nz-button type="button" nzType="primary" (click)="editRow(data.id)">编辑</button>
        <button nz-button type="button" nzDanger class="margin-button" (click)="delRow(data.id)">删除</button>
        <button nz-button type="button" class="margin-button" (click)="detailRow(data)">详情</button>
      </td>
    </tr>
  </tbody>
</nz-table>
<parking-area-selector (parkingAreaSelectedEvent)="handleParkingAreaSelectedEvent($event)"></parking-area-selector>
<room-selector (roomSelectedEvent)="handleRoomSelectedEvent($event)"></room-selector>
<parking-charge-add (addedEvent)="onAdded($event)"></parking-charge-add>
<parking-charge-view></parking-charge-view>
